/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;


import org.junit.jupiter.api.Test;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * <p>Project: jdemo202203 - DbUtilDemo
 * <p>Powered by webrx On 2022-11-03 11:45:24
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class DbUtilDemo {

    @Test
    void t2(){
        DbUtil du = new DbUtil();

        int rows = du.update("insert into t_student(name,birth,gender,score) values(?,?,?,?)","张三丽", LocalDate.now(),"女",80);
        System.out.println(rows);

        List<Map<String,Object>> list = du.query("select * from t_student");
        System.out.println(list);

    }



    @Test
    public void t1() {
        DbUtil du = new DbUtil("localhost",3306,"dbshop","root","");

        System.out.println(du.dbs());

        System.out.println(du.tbs());

        System.out.println(du.tbs("db"));

        System.out.println("------------------------------");
        du.connect();

        System.out.println(du.dbs());

        System.out.println(du.tbs());

        System.out.println(du.tbs("db"));

        du.close();
    }
}
